package com.auth_limit.model;

import java.util.List;

public class Auth_limitService {

	private Auth_limitDAO_interface dao;

	public Auth_limitService() {
		dao = new Auth_limitDAO();
	}

	public Auth_limitVO addAuth_limit(
		String auth_id,
		String auth_name,
		String auth_link) {

		Auth_limitVO auth_limitVO = new Auth_limitVO();

		auth_limitVO.setAuth_id(auth_id);
		auth_limitVO.setAuth_name(auth_name);
		auth_limitVO.setAuth_link(auth_link);

		dao.insert(auth_limitVO);

		return auth_limitVO;
	}

	public Auth_limitVO updateAuth_limit(	 
		String auth_id,
		String auth_name,
		String auth_link) {

		Auth_limitVO auth_limitVO = new Auth_limitVO();

		auth_limitVO.setAuth_id(auth_id);
		auth_limitVO.setAuth_name(auth_name);
		auth_limitVO.setAuth_link(auth_link);
		
		dao.update(auth_limitVO);

		return auth_limitVO;
	}

	public void deleteAuth_limit(String auth_id) {
		dao.delete(auth_id);
	}

	public Auth_limitVO getOneAuth_limit(String auth_id) {
		return dao.findByPrimaryKey(auth_id);
	}

	public List<Auth_limitVO> getAll() {
		return dao.getAll();
	}
}
